﻿using System;

namespace Snake.Gameplay.EffectComponents
{
    [Serializable]
    public class RemovalTagRequirements : GameplayEffectComponent
    {
        public string[] tags = new string[0];
        public bool checkAny;

        public override void OnUpdate(GameplayEffectSpec spec, float dt)
        {
            if (checkAny)
            {
                if (spec.Owner.TagContainer.HasAny(tags))
                {
                    spec.Invalid = true;
                }
            }
            else
            {
                if (spec.Owner.TagContainer.HasAll(tags))
                {
                    spec.Invalid = true;
                }
            }
        }
    }
}